package structure.queue;

import java.util.Queue;
import java.util.concurrent.ArrayBlockingQueue;

/**
 * @description: 数组模拟queue
 * @author: wangjun
 * @create: 2022-04-11
 */
public class QueueByArrayMain {

    public static void main(String[] args) {

        Queue<String> strings = new ArrayBlockingQueue(10);
    }

    public void testArrayImplQueue(){
        QueueByArray queue = new QueueByArray(2);
        queue.addQueue(10);
        queue.addQueue(20);
        queue.showQueue();
        // 10
        System.out.println("队列头数据：" + queue.headQueue());
        // 10
        System.out.println("队列头数据：" + queue.headQueue());
        // 10
        System.out.println("取出队列数据：" + queue.getQueue());
        // 20
        System.out.println("队列头数据：" + queue.headQueue());
        // 20
        System.out.println("取出队列数据：" + queue.getQueue());
    }

    public void testCycleArrayImplQueue(){
        QueueByCycleArray queue = new QueueByCycleArray();
//        queue.addQueue(10);
//        queue.addQueue(20);
//        queue.showQueue();
//        // 10
//        System.out.println("队列头数据：" + queue.headQueue());
//        // 10
//        System.out.println("队列头数据：" + queue.headQueue());
//        // 10
//        System.out.println("取出队列数据：" + queue.getQueue());
//        // 20
//        System.out.println("队列头数据：" + queue.headQueue());
//        // 20
//        System.out.println("取出队列数据：" + queue.getQueue());
    }
}